package com.zhongfu.ai.common.response;

public class Result {

    private String code;

    private Object data;

    private String msg;

    public static Result success(Object data){
        return new Result("200", data, "success");
    }

    public static Result error(Integer code, String msg){
        return new Result(code.toString(), null, msg);
    }
    public static Result error(String msg){
        return new Result("500", null, msg);
    }

    public Result(String code, Object data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
